//
//  TestFunButton.m
//  MKUITestApp
//
//  Created by 苏尚进 on 2022/2/22.
//  Copyright © 2022 moon. All rights reserved.
//

#import "TestFunButton.h"

@implementation TestFunButton
- (id)initWithFrame:(CGRect)frame{
    if (self=[super initWithFrame:frame]) {
        self.titleLabel.font = [UIFont systemFontOfSize:12];
        [self setTitleColor:[UIColor systemBlueColor] forState:UIControlStateNormal];
        self.contentInsets = MKUIEdgeInsetsMakeSameEdge(5);
        self.minHitSize = CGSizeMake(30, 50);
        self.layer.borderColor = [UIColor systemGrayColor].CGColor;
        self.layer.borderWidth = 1/[UIScreen mainScreen].scale;
        self.layer.cornerRadius = 3;
    }
    return self;
}
- (id)initWithTitle:(NSString *)title{
    if (self=[self initWithContentStyle:(MKUIFlowLayoutButtonContentStyleHorizontal)]) {
        [self setTitle:title forState:(UIControlStateNormal)];
    }
    return self;
}
- (CGSize)sizeThatFits:(CGSize)size{
    CGSize s = [super sizeThatFits:size];
    s.width = MAX(s.width,44);
    s.height = MAX(s.height,30);
    return s;
}
@end
